#coding=utf-8
'''
slots只对当前类有限制，继承类无影响
'''
class student(object):
    __slots__=('name','age')
s=student()
s.name='x'
s.age=25
#s.score=100
'''Traceback (most recent call last):
      Python Shell, prompt 5, line 1
    AttributeError: 'student' object has no attribute 'score'
    '''
class sstudent(student):
    print 'xxx'
g=sstudent()
g.score=666
g.score
#666